package com.lwj.diao;

import com.lwj.diao.handlers.ExecutorHandler;
import com.lwj.diao.handlers.IndexHandler;
import com.lwj.diao.handlers.WelcomeHandler;
import com.sun.net.httpserver.HttpServer;
import java.io.IOException;
import java.net.InetSocketAddress;

public class InitServer {
    private static final int PORT = 8080;

    public static void initServer() throws IOException {
        HttpServer server = HttpServer.create(new InetSocketAddress(8080), 0);
        server.createContext("/coder", new WelcomeHandler());
        server.createContext("/result", new ExecutorHandler());
        server.createContext("/index", new IndexHandler());
        server.createContext("/getResult", new GetResult());
        server.start();
    }
}

